<?php

/*

  Victory	$5

  Worth 1 Victory Point per Duchy you have.

 */

class Duke extends Card implements iVictory, iKingdom, iIntrigue {

    public function __construct() {
        parent::__construct("Duke", 5);
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    public function getDescription() {
        return array(
            "Worth 1 Victory Point per Duchy you have.");
    }
    
    public function play(Game $game, $isRealCard) {

    }

    public function getVictoryPoints(Game $game, $name) {
        $allCards = $game->getAllCards($name);
        $duchies = 0;
        $duchy = n2c("Duchy");
        $duchy_key = $duchy->getKey();
        foreach ($allCards as $card) {
            if ($card->getKey() == $duchy_key) {
                $duchies++;
            }
        }
        return $duchies;
    }

}

?>